/*
 * Created on Tue Sep 26 2017
 * @flow
 * Copyright (c) 2017 jianglinjie
 */
'use strict';

import Router from 'koa-router';
import CaptchasService from '../services/captcha';
import { createSucceedBody } from '../utils/BodyUtils';

const router = new Router();

router.post('/', async (ctx) => {
  let result = await CaptchasService.request(ctx.request.body);
  ctx.response.status = 201;
  ctx.response.body = createSucceedBody('验证码获取成功', result);
});

export default router;